package com.gxa.learning.pc.service;

import com.github.pagehelper.PageInfo;
import com.gxa.learning.core.exception.BusinessException;
import com.gxa.learning.core.pojo.ExamineApproval;
import com.gxa.learning.core.service.BaseService;

import java.util.Date;
import java.util.Map;

/**
 * 审批流程的service层
 *
 * @author lijianmin
 * @date 2021/12/03  10:15:05
 */
public interface ExamineApprovalService extends BaseService<ExamineApproval> {

    /**
     * 根据条件搜索的方法
     *
     * @param name             流程名称
     * @param state            流程状态
     * @param type             流程类型
     * @param departmentName   所属部门
     * @param creationTime     生效日期
     * @param uploadPeopleName 上传人
     * @param page             页码
     * @param size             每页数据量
     * @return 返回查询到的集合并根据分页条件分页
     */
    PageInfo<Map<String, Object>> selectByLikes(String name, Integer state, String type, String departmentName, Date creationTime, String uploadPeopleName, Integer page, Integer size) throws BusinessException;

    /**
     * 删除审批流程以及相关的流程节点的方法
     *
     * @param id 审批流程的id
     * @return 返回是否成功
     */
    Boolean deleteById(Long id);

    /**
     * 修改审批流程的方法
     *
     * @param map 修改的键值对
     * @return 返回是否修改成功
     * @throws BusinessException
     */
    Boolean updateExamineApproval(Map<String, Object> map) throws BusinessException;

    void add(Map<String, Object> map) throws BusinessException;

    void pass(Long id) throws BusinessException;

    void reject(Long id) throws BusinessException;
}
